<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="/WEB-INF/tld/iextend-common.tld" prefix="iextend"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>登录</title>
<%
String link="js/jquery-easyui-1.3.2";
%>
<link rel="stylesheet" type="text/css" href="<iextend:constant name="ContextPath" />/<%=link %>/themes/mythemes/easyui.css">
<link rel="stylesheet" type="text/css" href="<iextend:constant name="ContextPath" />/<%=link %>/themes/icon.css">
<script type="text/javascript" src="<iextend:constant name="ContextPath" />/<%=link %>/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<iextend:constant name="ContextPath" />/<%=link %>/jquery.easyui.min.js"></script>
<link rel="stylesheet" type="text/css" href="<iextend:constant name="ContextPath" />/css/global.css">
<style type="text/css">
*{padding:0; margin:0;}
</style>
</head>
<body onload="init()">
<jsp:include page="../template/navtop.jsp"></jsp:include>
<div style="margin:0 auto;width: 500px">
	<div class="easyui-panel" title="登录" style="width: 450px;" > 
		<div style="padding:10px 0 10px 60px">
			<form id="loginForm" class="loginFormCss" action="<iextend:constant name="ContextPath" />/user/login" method="post">
				<table>
					<tr>
						<td>用户名:</td>
						<td>
							<input class="easyui-validatebox" type="text" name="email" data-options="required:true,validType:'email'" />
						</td>
					</tr>
					<tr>
						<td>密&nbsp;码:</td>
						<td>
							<input class="easyui-validatebox" type="password" name="password" data-options="required:true" />
						</td>
					</tr>
				</table>
			</form>
		</div>
		<div style="text-align:center;padding:5px">  
       <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">Submit</a>  
       <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()">Clear</a>  
    </div> 
	</div>
	<div>
		<a href="<%=request.getContextPath()%>/user/viewRegister">注册</a>
	</div>
</div>
<script>  
        function submitForm(){  
            //$('#loginForm').form('submit'); 该方法只提交数据，不提交表单，页面不跳转  
            if($('#loginForm').form('validate')){
        		$('#loginForm').submit(); 
            }else{
            	alert("验证不通过");
            }
        }  
        function clearForm(){  
            $('#loginForm').form('clear');  
        }  
      //页面初始化
        function init(){
        	$(':input','.loginFormCss')
        	 .not(':button, :submit, :reset, :hidden')
        	 .val('')
        	 .removeAttr('checked')
        	 .removeAttr('selected');
        }
</script> 
<c:if test="${model.msg!=null}">
<script type="text/javascript">
//jQuery.messager.alert('消息','${command}','error');
//右下角弹出框;  
		jQuery.messager.show({
			title : '提示',
			msg : '${model.msg}',
			timeout : 5000,
			showType : 'slide'
		});
</script>
</c:if>

</body>
</html>